package com.panshi.service.impl;

import com.panshi.entity.AppMatterCheckT;
import com.panshi.entity.AppMatterT;
import com.panshi.entity.ClassifyT;
import com.panshi.service.QaClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class QaClientServiceFallbackFactory implements FallbackFactory<QaClientService> {
    @Override
    public QaClientService create(Throwable cause) {
        System.out.println("服务降级  ---- classify qa");
        return new QaClientService() {
            @Override
            public Boolean matterReadAdd(int matterId) {
                return false;
            }

            @Override
            public Boolean matterCommAdd(int matterId) {
                return false;
            }


            @Override
            public List<AppMatterT> amall() {
                return new ArrayList<>();
            }

            @Override
            public ClassifyT bycid(Integer id) {
                return new ClassifyT();
            }

            @Override
            public List<ClassifyT> zall() {
                return new ArrayList<>();
            }

            @Override
            public AppMatterT matById(int id) {
                return new AppMatterT();
            }

            @Override
            public List<AppMatterT> qaPage(int cid,int page, int limit, String type) {
                return new ArrayList<>();
            }

            @Override
            public List<AppMatterT> qaAnTypePage(int cid, int page, int limit, String type, int answerCount) {
                return new ArrayList<>();
            }

            @Override
            public Boolean setMatterCheckAdd(AppMatterCheckT appMatterCheckT) {
                return false;
            }
        };
    }
}
